package 语法


def x = 1.23
println x.class
def result = 1.23
//case在groovy中的可以是任意对象，也可以判断类型
//在java中
switch (x){
    case 'foo':
        result = 'foo'
        break;
    case 'bar':
        result = 'bar'
        break
    case [4,5,6,'list']: //一个列表
        result = 'list'
        break
    case 12..30://一个范围
        result= 'rang'
        break;
    case Integer:
        result ='Integer'
        break;
    case Double :
        result= 'Double'
        break;
    case BigDecimal :
        result= 'BigDecimal'
        break;
    case double :
        result= 'double'
        break;
    default:
        result = "default"
        break
}
println result